PROJECT(NIFTICDFLIB)

INCLUDE_DIRECTORIES(${NIFTILIB_SOURCE_DIR})
#INCLUDE_DIRECTORIES(/usr/include/nifti)
SET(NIFTICDFLIB_SRC nifticdf.c)

SET(NIFTI_CDFLIB_NAME ${PACKAGE_PREFIX}nifticdf)

ADD_LIBRARY(${NIFTI_CDFLIB_NAME} ${NIFTICDFLIB_SRC} )

IF (BUILD_SHARED_LIBS)
  SET_TARGET_PROPERTIES(${NIFTI_CDFLIB_NAME} PROPERTIES ${NIFTI_LIBRARY_PROPERTIES})
ENDIF (BUILD_SHARED_LIBS)


IF(NOT NIFTI_INSTALL_NO_LIBRARIES)
  INSTALL(TARGETS ${NIFTI_CDFLIB_NAME}
    RUNTIME DESTINATION ${NIFTI_INSTALL_BIN_DIR} COMPONENT RuntimeLibraries
    LIBRARY DESTINATION ${NIFTI_INSTALL_LIB_DIR} COMPONENT RuntimeLibraries
    ARCHIVE DESTINATION ${NIFTI_INSTALL_LIB_DIR} COMPONENT Development)
ENDIF(NOT NIFTI_INSTALL_NO_LIBRARIES)

IF(NOT NIFTI_INSTALL_NO_DEVELOPMENT)
  FILE(GLOB __files "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
  INSTALL(FILES ${__files}
    DESTINATION ${NIFTI_INSTALL_INCLUDE_DIR}
    COMPONENT Development)
ENDIF(NOT NIFTI_INSTALL_NO_DEVELOPMENT)
